package com.photo.dao.hibernate;

import org.springframework.orm.hibernate.support.HibernateDaoSupport;
import com.photo.dao.domain.User;
import com.photo.dao.UserDao;

import java.util.List;

import net.sf.hibernate.Session;
import net.sf.hibernate.Query;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.HibernateException;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2008-8-29
 * Time: 14:18:08
 * To change this template use File | Settings | File Templates.
 */
public class HbmUserDao extends HibernateDaoSupport implements UserDao {
    public Integer insertUser(User user) {
         getHibernateTemplate().saveOrUpdate(user);
        return new Integer(0);
    }

    public List queryUser(User user) {
        return getHibernateTemplate().find("from User u");
    }

    public void updateUser(User user) {


        getHibernateTemplate().update(user);
    }
}
